import { observable, action } from "mobx";
import AppChartStore from "./ChartStore";
import AppDataStore from "./DataStore";

export default class AppAnalysisStore {
  @observable selectedIndex = 0;
  @observable dataStore = new AppDataStore();
  @observable chartStore = new AppChartStore();

  @action init = appid => {
    this.dataStore.init(appid);
    this.chartStore.init(appid);
  }

  @action onSelectedIndexChange = selectedIndex => {
    this.selectedIndex = selectedIndex;
  }

  @action initState = () => {
    this.selectedIndex = 0;
    this.dataStore.initState();
    this.chartStore.initState();
  }
}